/*
 * @Author: HeAo
 * @Date: 2021-09-28 09:30:46
 * @LastEditTime: 2021-09-28 09:47:59
 * @LastEditors: HeAo
 * @Description:
 * @FilePath: \web2103-2105\web2103code\3-1-ES6\day04\2-class继承.js
 * 别乱动！
 */
class Animal {
  static animalAttr = 'Animal静态属性'
  constructor(name, age) {
    this.name = name
    this.age = age
  }
  animalFun () {
    console.log('Animal实例方法');
  }
  static animalStaFun () {
    console.log('Animal静态方法');
  }
}

class Dog extends Animal {
  constructor(name, age, color, weight) {
    super(name, age)
    this.color = color
    this.weight = weight
  }
}

// 继承了Animal类的实例属性和实例方法
let dog = new Dog('二狗', 1, 'black', '10kg')
console.log(dog);
dog.animalFun()


// 继承Animal类的静态属性和静态方法
console.log(Dog.animalAttr);
Dog.animalStaFun()

console.log(Dog.prototype.__proto__ === Animal.prototype);
console.log(dog.__proto__.__proto__ === Animal.prototype);

console.log(Dog.__proto__ === Animal);

